package com.easyframe.system.module;

import java.util.ArrayList;
import java.util.List;

import com.easyframe.system.domain.Menu;
import com.easyframe.system.domain.MenuList;
import com.easyframe.system.service.MenuService;

public class MenuAction extends BaseAction {
	private MenuService menuService;

	public void setMenuService(MenuService menuService) {
		this.menuService = menuService;
	}

	List<Menu> menuList = new ArrayList();
	List<MenuList> treeList = new ArrayList();
	private String rootId;
	private String rootName;

	public String getRootId() {
		return rootId;
	}

	public void setRootId(String rootId) {
		this.rootId = rootId;
	}

	public String getRootName() {
		return rootName;
	}

	public void setRootName(String rootName) {
		this.rootName = rootName;
	}

	public List<MenuList> getTreeList() {
		return treeList;
	}

	public void setTreeList(List<MenuList> treeList) {
		this.treeList = treeList;
	}

	public List<Menu> getMenuList() {
		return menuList;
	}

	public void setMenuList(List<Menu> menuList) {
		this.menuList = menuList;
	}

	public String execute() throws Exception {
		menuList = menuService.queryMenulist();
		return SUCCESS;
	}

	public String menuForTree() throws Exception {
		treeList = menuService.queryMenuListForTree(1);
		rootId = "1";
		rootName = "系统配置";

		return SUCCESS;
	}
}
